Behavioural Subtyping for a Type-theoretic Model of Objects

نویسنده

  • Erik Poll
چکیده

We present a reenement of the existential object model of Pierce and Turner PT94]. In addition to signatures (or interfaces) as the types of objects, we also provide classes as the types of objects. These class types not only specify an interface, but also a particular implementation. We show that class types can be interpreted in the standard PER model. Our main result is that the standard interpretation of subtyping in PER models { i.e. subtypes are subpers { is then behavioural subtyping in the sense of Leavens Lea90]. 1 Introduction Like most descriptions of objects in typed lambda calculus or typed object calculus, the existential object model of Pierce and Turner PT94] provides signatures or interfaces as the types of objects, and provides the usual syntactic notion of subtyping on these types. We consider a more reened notion of class type as the type of an object. A class type is a subtype of an interface type, speciied by a particular implementation and initial state. The existential object encoding can be carried out in F ! , but the class types we want to consider are not encodable in F !. Therefore we will deene a simple object-oriented functional language OO , that is essentially just some syntactic sugar for the existential object encoding, but extended with a notion of class type. The standard model of F ! is a PER model, which interprets types as partial equivalence relations (pers), and interprets subtyping as subset inclusion between pers BL90]. We show that class types can be interpreted in the PER model. For these interpretations of class types the subset relation turns out to be equivalent to the notion of behavioural sub-typing as deened by Leavens Lea90]. It is important to note that class types can be behavioural subtypes even though they give completely unrelated implementations. Although class types correspond to particular implementations, behavioural subtyping between class types

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Formalization of Coercions in Lexical Semantics

Originally developed for use in programming languages with simple type systems (see, for example, [22]), coercions between types, including many subtypes of the type of entities (eventualities, physical objects, informational objects, etc.), have been widely employed in linguistic semantics [26, 30, 28, 3]. There are, however, two problems with coercions. First, it has been unclear how coercion...

متن کامل

Weak behavioral subtyping for types with mutable objects

This paper studies the question of when one abstract data type (ADT) is a behavioral subtype of another, and proposes a model-theoretic notion of weak behavioral subtyping. Weak behavioral subtyping permits supertype abstraction to be a sound and modular reasoning principle in a language with mutation and limited forms of aliasing. The necessary restrictions on aliasing can be statically checked.

متن کامل

Behavioural Subtyping in Name Passing Synchronisation Trees

We present a general theory of behavioural subtyping for name passing interactive behaviours using early name-passing synchronisation trees. In this theory types are collections of name passing synchronisation trees organised by typed variants of process-theoretic operations, and a simple behavioural notion of subtyping speciies when one type denotes more constrained behaviours than another, oo...

متن کامل

Interpretations of Extensible Objects and Types

We present a type-theoretic encoding of extensible objects and types. The ambient theory is a higher-order-calculus with poly-morphic types, recursive types and operators, and subtyping. Using this theory, we give a type preserving and computationally adequate translation of a full-edged object calculus that includes object extension and override. The translation specializes to calculi of nonex...

متن کامل

Simple Type-Theoretic Foundations for Object-Oriented Programming

We develop a formal, type-theoretic account of the basic mechanisms of object-oriented programming: encapsulation, message passing, subtyping, and inheritance. By modeling object encapsulation in terms of existential types instead of the recursive records used in other recent studies, we obtain a substantial simpliication both in the model of objects and in the underlying typed-calculus.

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1998